import Request from "@/request/index.js";

//关键字小区搜索（当前区域）
export function getCommunity(name){
	return Request(`/front/house/community/area?area=昆山&name=${name}`, "get", null)
}
//关键字房东搜索
export function getLandlordName(name){
	return Request(`/front/broker/search/${name}`, "get", null)
}
//获取经纬度
export function getRegeo(){
	return Request(`/front/map/regeo`, "get", null)
}
//获取首页轮播图
 
export function getCarousel(){
	return Request(`/front/landlord/banner/list`, "get", null)
 }
 
//刷新房源
export function getRefresh(){
	return Request(`/front/landlord/room/refresh`, "put", null)
}
//获取经营概览
export function getBusiness(){
	return Request(`/front/landlord/room/business`, "get", null)
}
//获取房东的房源数量
export function getQuantity(){
	return Request(`/front/landlord/room/quantity`, "get", null)
}
// 房东或经纪人新增房源信息
export function addHouseInfo(houseInfo){
	return Request(`/front/broker/room`, "post", houseInfo)
}

// 获取经纪人已录入的小区列表
export function getHouse(){
	return Request(`/front/broker/room/community/list`, "get", null)
}
// 获取经纪人已录入的小区房源列表
export function getHouseList(rentState=""){
	return Request(`/front/broker/room/list?rentState=${rentState}`, "get", null)
}

// 获取房东的所有房源列表（条件查询）

export function getListCommunityId(communityId = "",rentState = ""){
	return Request(`/front/landlord/room/list?communityId=${communityId}&rentState=${rentState}`, "get", null)
}

// 根据房源编号获取房源详情拼接参数
export function getLandlord(houseId){
	return Request(`/front/landlord/room/${houseId}`, "get", null)
}
 
 // 修改房源信息要先获取房源详情然后修改，媒体资源如果不传会把原有的删掉

export function putHouse(houseInfo){
	return Request(`/front/landlord/room`, "put", houseInfo)
}


//  新增租约会修改房源出租状态 

// /front/landlord/lease
export function landlordLease(houseInfo){
	return Request(`/front/landlord/lease`, "post", houseInfo)
}

//  获取当前房东的所有租约
export function landgetConfirm(leaseConfirmState = ''){
	return Request(`/front/landlord/lease/getConfirm/${leaseConfirmState}`, "get", null)
}

export function agentgetConfirm(data){
	return Request(`/front/broker/lease/getConfirm`, "post", data)
}
//  待确认租约详情
export function leaseDetail(id){
	return Request(`/front/broker/lease?${id}`, "get", null)
}
 // 分享房源列表
 export function shareHomeList(data){
 	return Request(`/front/broker/share/home/list?${data}`, "get", null)
 }
//分享房源详情接口
export function shareDetail(houseId){
 	return Request(`/front/broker/share/detail?houseId=${houseId}`, "get", null)
 }















// export function  homeListPage (pageNum = 1,pageSize = 100,keyWords = "",rentalRange = "", rentalType = "",houseType = "",labelName = "",houseState = "") {
// 	return Request(`/front/broker/room/homePage?pageNum=${pageNum}&pageSize=${pageSize}&keyWords=${keyWords}&rentalRange=${rentalRange}&rentalType=${rentalType}&houseType=${houseType}&labelName=${labelName}&houseState=${houseState}`,'get',null)
// }
 export function  homeListPage(data) {
	 return Request('/front/broker/room/homePage', 'post', data)
 }
export function getDetail(id){
	return Request(`/front/broker/room/detail?houseId=${id}`, "get", null)
}

export function getStartList(data){
	return Request(`/front/house/broker/collection/list`, "post", data)
}


// 批量删除收藏房源


export function deleteStars(idList){
	return Request(`/front/house/broker/collection/deleteByCollectionIdList`, "post", idList)
}

//  新增收藏

export function addStar (data) {
	return Request(`/front/house/broker/collection/add`, "post", data)
}


export function getImgList() {
	return Request('/front/broker/banner/findByBrokerBannerList', 'get', null)
}

export function getUserInfo() {
	return Request('/front/broker/userInfo', 'get', null)
}

export function putHouseState(id) {
	return Request(`/front/broker/room/all/${id}`, 'put', null)
}

//查询服务器app版本
export function getServerAppVersion(id) {
	return Request(`/front/queryVersion?appClient=2&devType=android`, 'get', null)
}

//获取二维码
export function getQrcode(base64Url) {
	return Request(`/front/media/getQrCode?shareUrl=`+base64Url, 'get', null)
}


// 转租api
//  经纪人代租客发起转租


export function subLease(data) {
	return Request(	`/front/broker/sublet`, 'post', data)
}


// 取消转租
export function putLease(data) {
	return Request(	`/front/broker/sublet`, 'put', data)
}


